/**
 * @projectName: com.xiayuanxing.designPattern
 * @className: Decorator
 * @author: xiayuanxing
 * @description: TODO
 * @date: 2021/12/28 11:19
 * @version: 1.0
 */
public class Decorator extends Drink{

    private Drink obj;

    //构造函数
    public Decorator(Drink obj) {
        this.obj = obj;
    }

    @Override
    public float cost() {
        return super.getPrice() + obj.cost();
    }

    @Override
    public String getDes(){
        return des + ""+getPrice()+"&&"+obj.getPrice();
    }
}
